import { IFeidaoAiBrowserComponent } from '@dfeidao/atom-web/interfaces';
import get from '@dfeidao/atom-web/local/get';
import fire from '@dfeidao/atom-web/msg/fire';
import nodejs from '@dfeidao/atom-web/msg/nodejs';
import hide from '@dfeidao/atom-web/ui/hide';
import set_node_cls from '@dfeidao/atom-web/ui/set-node-cls';

export default async function a002(fd: IFeidaoAiBrowserComponent) {
	//
	const dy = fd.data.node.querySelector<HTMLDivElement>('[data-id="diaoY"]');
	const no = get(fd, 'no');
	// 判断删除成功失败
	set_node_cls(dy, 'display-n', true);
	hide(fd.data.node);
	const ret = await nodejs<{ code: 0 | 1, result: string }>('meeting-management/zj-000005/s001', {
		meeting_no: no
	});
	if (ret.code === 1) {
		alert('删除成功');
	// fire('zj-000001', 'a001');
		fire('zj-000001', 'a005');
	} else {
		alert('删除失败：' + ret.result);
	}
}
